from dataclasses import dataclass
from typing import Optional, Union
from pathlib import Path

@dataclass
class PreviewContent:
    file_path: str
    file_type: str
    preview_data: Union[str, bytes]
    thumbnail_path: Optional[str] = None
    file_size: int = 0
    modified_time: float = 0
    
    @property
    def filename(self) -> str:
        return Path(self.file_path).name 